package com.lc.springboot.controller;

import com.lc.springboot.model.SysUser;
import com.lc.springboot.service.ISysUserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author lengchuan <lishuijun1992@gmail.com>
 * @date 16-8-24
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private ISysUserService sysUserService;

    @RequestMapping("/addUser")
    @ResponseBody
    @RequiresPermissions("/user/addUser")//权限注解
    public SysUser addUser(SysUser  user){
        sysUserService.addUser(user);
        return user;
    }

    @RequestMapping("/userSetting")
    @ResponseBody
    public String userSetting(){
        return "用户设置";
    }

    @RequestMapping("/userInfo")
    @ResponseBody
    public String userInfo(){
        return "用户信息";
    }

}
